package com.lw.structural.decorator.dec;

import com.lw.structural.decorator.shape.Shape;

//通过实现解决：继承过多子类膨胀，不想增加很多子类的情况
public abstract class ShapeDecorator implements Shape {
   protected Shape decoratedShape;

   //构造方法，在其中添加需要扩展的对象
   public ShapeDecorator(Shape decoratedShape){
      this.decoratedShape = decoratedShape;
   }

   //给对象扩展功能
   public void draw(){
      decoratedShape.draw();
   }  
}